package com.demo.seckill.web;

import com.demo.seckill.common.entity.Result;
import com.demo.seckill.service.ICreateHtmlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author libo
 * @ClassName CreateHtmlController
 * @date 2018/12/5 15:46
 */
@Api(tags ="生成静态商品页")
@RestController
@RequestMapping("/createHtml")
public class CreateHtmlController {

    private final static Logger LOGGER = LoggerFactory.getLogger(CreateHtmlController.class);

    @Autowired
    private ICreateHtmlService createHtmlService;

    @ApiOperation(value="生成静态商品页")
    @PostMapping("/start")
    public Result start(){
        LOGGER.info("生成秒杀活动静态页");
        return createHtmlService.createAllHtml();
    }
}
